﻿using Microsoft.Graphics.Canvas;
using Microsoft.Graphics.Canvas.Effects;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
using Windows.UI;
using Color = Windows.UI.Color;

namespace 纸片人.win2dEffectControl.DataClass
{
    internal class VignetteEffectData : EffectOneSourceData
    {
        private float amount=0.1f;
        private Vector4 _colorHdr = new Vector4(0, 0, 0, 1);
        private Color _color = Colors.Black;
        private float curve=0.5f;

        public float Amount { get => amount; set { amount = value; OnPropertyChanged(); SetIsChanges(); } }
        public Vector4 ColorHdr { get => _colorHdr; set { _colorHdr = value; OnPropertyChanged(); SetIsChanges(); } }
        public Color Color { get => _color; set { _color = value; OnPropertyChanged(); SetIsChanges(); } }

        public float Curve { get => curve; set { curve = value; OnPropertyChanged(); SetIsChanges(); } }

        #region 属性

        #endregion
        public override ICanvasImage GetEffect(CanvasDevice device, bool compression)
        {
            var source = GetSourceEffect(device, compression);
            if (source == null)
                return null;
            var ve = new VignetteEffect();
            var effect = new VignetteEffect()
            {
                Source = source,
                Amount = Amount,
                ColorHdr = ColorHdr,
                Color = Color,
                Curve = Curve

            };

            return effect;
        }


    }
}
